import json

def get_process_by_prompt(_prompt, _node):
    total = len(_prompt)
    model_dict = {}

    def func(prompt, node):
        nonlocal model_dict
        node_str = str(node)
        if node_str in prompt and prompt[str(node)]['inputs'] is not None:
            if node_str not in model_dict:
                model_dict[node_str] = prompt[node_str]
            inputs = prompt[node_str]['inputs']
            for key in inputs:
                if isinstance(inputs[key], list):
                    for n in inputs[key]:
                        func(prompt, n)
    func(_prompt, _node)
    return len(model_dict) / total
